/*****************************************************************************
 * Copyright (c) 2010 -, Anders All rights reserved
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  Contact: Anders Uddenberg (anders.uddenberg@gmail.com)
 * 
 *
 ****************************************************************************/
package org.easypr.organizer.client;

import java.util.ArrayList;

import org.easypr.organizer.shared.MyContact;
import org.easypr.organizer.shared.MyMeeting;
import org.easypr.organizer.shared.MyUser;

import com.google.gwt.user.client.rpc.AsyncCallback;

// TODO: Auto-generated Javadoc
/**
 * The Interface BackboneServiceAsync.
 */
public interface BackboneServiceAsync {
	
	/**
	 * Save user.
	 *
	 * @param user the user
	 * @param callback the callback
	 */
	public void saveUser(MyUser user, AsyncCallback<MyUser> callback);
	
	/**
	 * Save contact.
	 *
	 * @param contact the contact
	 * @param callback the callback
	 */
	public void saveContact(MyContact contact, AsyncCallback<MyContact> callback);
	
	/**
	 * Fetch contacts.
	 *
	 * @param user the user
	 * @param filter the filter
	 * @param callback the callback
	 */
	public void fetchContacts(MyUser user, String filter, AsyncCallback<ArrayList<MyContact>> callback);
	
	/**
	 * Search.
	 *
	 * @param searchString the search string
	 * @param user the user
	 * @param callback the callback
	 */
	public void search(String searchString, MyUser user, AsyncCallback<ArrayList<MyContact>> callback);
	
	/**
	 * Live search.
	 *
	 * @param searchString the search string
	 * @param user the user
	 * @param callback the callback
	 */
	public void liveSearch(String searchString, MyUser user, AsyncCallback<ArrayList<MyContact>> callback);
	
	/**
	 * Gets the by id.
	 *
	 * @param id the id
	 * @param callback the callback
	 * @return the by id
	 */
	public void getById(long id, AsyncCallback<MyContact> callback);
	
	/**
	 * Save meeting.
	 *
	 * @param meeting the meeting
	 * @param callback the callback
	 */
	public void saveMeeting(MyMeeting meeting, AsyncCallback<MyMeeting> callback);
	
	/**
	 * Gets the meetings.
	 *
	 * @param user the user
	 * @param contactid the contactid
	 * @param beforeTime the before time
	 * @param callback the callback
	 * @return the meetings
	 */
	public void getMeetings(MyUser user, long contactid, int beforeTime, AsyncCallback<ArrayList<MyMeeting>> callback);
	
	/**
	 * Gets the meetings navigation.
	 *
	 * @param userEmail the user email
	 * @param contactid the contactid
	 * @param beforeTime the before time
	 * @param callback the callback
	 * @return the meetings navigation
	 */
	public void getMeetingsNavigation(String userEmail, long contactid, int beforeTime, AsyncCallback<ArrayList<Integer>> callback);
	
	/**
	 * Gets the o auth request url.
	 *
	 * @param user the user
	 * @param callbackURL the callback url
	 * @param callback the callback
	 * @return the o auth request url
	 */
	public void getOAuthRequestURL(MyUser user, String callbackURL, AsyncCallback<String> callback);
	
	/**
	 * Fetch google contacts.
	 *
	 * @param user the user
	 * @param nextFeedURL the next feed url
	 * @param callback the callback
	 */
	public void fetchGoogleContacts(MyUser user, String nextFeedURL, AsyncCallback<ArrayList<MyContact>> callback);
	
	/**
	 * Gets the import next link.
	 *
	 * @param callback the callback
	 * @return the import next link
	 */
	public void getImportNextLink(AsyncCallback<String> callback);
	
	/**
	 * Delete contact.
	 *
	 * @param contact the contact
	 * @param callback the callback
	 */
	public void deleteContact(MyContact contact, AsyncCallback<Boolean> callback);
	
	/**
	 * Delete meeting.
	 *
	 * @param id the id
	 * @param callback the callback
	 */
	public void deleteMeeting(long id, AsyncCallback<Boolean> callback);
}
